#! /bin/sh

SUDOCMD=doas

killall pipewire-pulse
killall pipewire

pipewire &
sleep 1
pipewire-pulse &
wireplumber &
sleep 1

pidpp=`pidof -s pipewire-pulse`
pidpw=`pidof -o $pidpp -s pipewire`
pidwp=`pidof -s wireplumber`

$SUDOCMD renice -n -10 -p $pidpw
$SUDOCMD renice -n -10 -p $pidwp
$SUDOCMD renice -n -10 -p $pidpp

$SUDOCMD ionice -c 1 -n 1 -p $pidpw
$SUDOCMD ionice -c 1 -n 1 -p $pidwp
$SUDOCMD ionice -c 1 -n 1 -p $pidpp


exit 0
